package com.itheima.factorybean;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @author CC小天才
 * @website www.flyskill.cn
 * @date 2021/9/22 19:59
 **/

public class MyAspect implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        check_Permission();
        Object obj =methodInvocation.proceed();
        log();
        return obj;
    }

    public void check_Permission(){
        System.out.println("模拟检查权限...");
    }

    public void log(){
        System.out.println("模拟记录日志...");
    }
}
